package main

import (
	"fmt"
	"log"
	"net/http"

	"github.com/go-programing-tour-book/chatroom/global"
	"github.com/go-programing-tour-book/chatroom/server"

	_ "net/http/pprof"
)

var (
	addr   = ":8081"
	banner = "go语言实现聊天室"
)

func init() {
	global.Init()
}

func main() {
	fmt.Println(banner + "addr: " + addr)

	server.RegisterHandle()

	//log.Fatal：http.ListenAndServe出错的话，直接终止程序，打印返回错误
	log.Fatal(http.ListenAndServe(addr, nil))

}
